package cn.itcast.consumer.web;

import cn.itcast.consumer.feign.UserFeignApi;
import cn.itcast.consumer.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 飞羽鸿蒙
 * @date: 2020/12/23 20:09
 */
@RestController
@RequestMapping("feign")
public class FeignController {

    @Autowired
    UserFeignApi userFeignApi;

    @GetMapping("/{id}")
    public User queryUserById(@PathVariable("id") String id) {
        return userFeignApi.queryUserById(id);
    }

}
